Comment: NeoEE Patch Setup Project
Set Variable #CODEPAGE# to OEM_CHARSET
 
[DEFINE REGION: Check Application Requirements]
Get System Setting Windows 8 into win8check
Read Registry Key HKCU\Software\SSSI\Empire Earth\Installed From Volume into EECDrive
Read Registry Key HKCU\Software\SSSI\Empire Earth\Installed From Directory into EECDIR
Set Variable TARGETDIR to $EECDrive$$EECDIR$
Does File Exist $TARGETDIR$\Data\data.ssa (get result into variable EECHECK)
Read from Text File C:\2.dat into Variable rr
if Variable EECHECK not Equals TRUE
  Set Variable TARGETDIR to "Please Select Your Empire Earth"
end
Read Registry Key HKCU\Software\Mad Doc Software\EE-AOC\Installed From Volume into AOCDrive
Read Registry Key HKCU\Software\Mad Doc Software\EE-AOC\Installed From Directory into AOCDIR
Set Variable TARGETDIRAOC to $AOCDrive$$AOCDIR$
Read from Text File $SUPPORTDIR$\1.dat into Variable rr
Does File Exist $TARGETDIRAOC$\Data\data.ssa (get result into variable AOCExists)
if Variable AOCExists not Equals TRUE
  Does File Exist C:\Sierra\Empire Earth - The Art of Conquest\Data\data.ssa (get result into variable defaultaocdir)
  if Variable defaultaocdir not Equals TRUE
    Does File Exist C:\Sierra\EE-ZDE\Data\data.ssa (get result into variable CHECKAOC2)
    if Variable CHECKAOC2 not Equals TRUE
      Does File Exist C:\Sierra\EE-AOC\Data\data.ssa (get result into variable CHECKAOC3)
      if Variable CHECKAOC3 not Equals TRUE
        Set Variable TARGETDIRAOC to 
      else
        Set Variable TARGETDIRAOC to C:\Sierra\EE-AOC\
      end
    else
      Set Variable TARGETDIRAOC to C:\Sierra\EE-ZDE\
    end
  else
    Set Variable TARGETDIRAOC to C:\Sierra\Empire Earth - The Art of Conquest\
  end
else
  Set Variable TARGETDIRAOC to $AOCDrive$$AOCDIR$
end
if Variable TARGETDIR Equals "Please Select Your Empire Earth"
  Does File Exist C:\Sierra\Empire Earth\Data\data.ssa (get result into variable TargetExists)
  if Variable TargetExists Equals TRUE
    Set Variable TARGETDIR to C:\Sierra\Empire Earth\
  else
    Does File Exist D:\Sierra\Empire Earth\Data\data.ssa (get result into variable TargetExists)
    if Variable TargetExists Equals TRUE
      Set Variable TARGETDIR to D:\Sierra\Empire Earth\
    else
      Does File Exist E:\Sierra\Empire Earth\Data\data.ssa (get result into variable TargetExists)
      if Variable TargetExists Equals TRUE
        Set Variable TARGETDIR to E:\Sierra\Empire Earth\
      else
        Read Registry Key HKLM\SOFTWARE\Alpha1.5\AlphaDirectory into TARGETDIR
        Does File Exist $TARGETDIR$\Data\data.ssa (get result into variable check1)
        if Variable check1 not Equals TRUE
          Set Variable TARGETDIR to 
        end
        if Variable TARGETDIR Equals 
          Read Registry Key HKLM\SOFTWARE\Sierra OnLine\Setup\EEARTH\Directory into TARGETDIR
          Does File Exist $TARGETDIR$\Data\data.ssa (get result into variable check2)
          if Variable check2 not Equals TRUE
            Set Variable TARGETDIR to 
          end
          if Variable TARGETDIR Equals 
            Read Registry Key HKLM\SOFTWARE\Alpha2.8\AlphaDirectory into TARGETDIR
            Does File Exist $TARGETDIR$\Data\data.ssa (get result into variable check3)
            if Variable check3 not Equals TRUE
              Set Variable TARGETDIR to 
            end
            if Variable TARGETDIR Equals 
              Set Variable TARGETDIR to "Please Select Your Empire Earth"
            end
          end
        end
      end
    end
  end
end
Does File Exist $TARGETDIR$\readme_DSML_AddOn.txt (get result into variable version2)
if Variable version2 Equals TRUE
  Set Variable oldversionEE to 2.0.0.0
else
  Does File Exist $TARGETDIR$\readme.1.0.4.0.txt (get result into variable version1.04)
  if Variable version1.04 Equals true
    Set Variable oldversionEE to 1.0.4.0
  else
    Set Variable oldversionEE to 1.0.0.0
  end
end
Set Variable versionaoc to Version : 1.0.0.0
Does File Exist $TARGETDIR$\Update Notes.txt (get result into variable OmegaExists)
Set Variable patchphrase to None
if Variable OmegaExists Equals TRUE
  Set Variable patchphrase to "Omega"
end
Does File Exist $TARGETDIR$\sxlrt234.dll (get result into variable RCExists)
if Variable RCExists Equals TRUE
  Set Variable patchphrase to "RC"
end
Set Variable patchphraseAOC to Patch : None
Does File Exist $TARGETDIRAOC$\Update Notes.txt (get result into variable OmegaExistsAOC)
if Variable OmegaExistsAOC Equals TRUE
  Set Variable patchphraseAOC to Patch : "Omega"
end
Comment: From Here ------------------------------------------------>>>>
Set Variable notfound to 
Set Variable Ins_Rei to 
Does File Exist $TARGETDIRAOC$\EE-AOC.exe (get result into variable AOC_Exists)
if Variable AOC_Exists not Equals TRUE
  Set Variable notfound to Game Not Found 
  Set Variable Ins_Rei to Install or Reinstall AOC
  Set Variable versionoldAOC to 
  Set Variable languagegameAOC to 
  Set Variable patchphraseAOC to 
  Set Variable versionaoc to 
end
[END REGION]
 
[DEFINE REGION: Check/Install Application Pre-Requisites]
 
[DEFINE REGION: Check Application Pre-Requisites]
Comment: Check setup pre-requisites
Set Variable PREREQ to FALSE
Set Variable PRELIST to 
[compiler if Variable BUILDMODE not Equals PATCH]
if Variable NEEDSUPGRADE Equals TRUE
  Set Variable PREREQ to TRUE
  Set Variable PRELIST to $PRELIST$$NEWLINE$Previous Version Uninstallation
end
[compiler end]
[END REGION]
 
[DEFINE REGION: Install Application Pre-Requisites]
Comment: Install setup pre-requisites
if Variable PREREQ not Equals FALSE
  Display Dialog: prereq, wait for dialog to return (modal)
  if Variable WIZARD Equals CANCEL
    Terminate Installation
  end
  Display Dialog: progressprereq, use as progress dialog (non-modal)
  [compiler if Variable BUILDMODE not Equals PATCH]
  if Variable NEEDSUPGRADE Equals TRUE
    Set Variable REMOVEOLD to 
    Set Variable ERROROLD to 
    Install/Remove MSI Package $PRODUCTCODE$[REMOVE=ALL] (get result into variable REMOVEOLD)
    if Variable REMOVEOLD Equals ERROR
      MessageBox: $TITLE$ Setup, Unable to uninstall old version of $TITLE$. Please uninstall it yourself using Control Panel Add-Remove Programs before attempting to install this product.$NEWLINE$$NEWLINE$$ERROROLD$
      Terminate Installation
    end
    if Variable REMOVEOLD Equals REBOOT
      MessageBox: $TITLE$ Setup, Your computer needs to be restarted before $TITLE$ Setup can continue.$NEWLINE$$NEWLINE$Please save your work in all running programs and click OK to restart your computer. Setup will resume once your computer restarts.$NEWLINE$$NEWLINE$If you click CANCEL, setup will exit. You will have to run setup again at a later time to install $TITLE$.
      if Variable REBOOTNOW Equals OK
        Reboot Computer and Resume Setup
      else
        Terminate Installation
      end
    end
    Set Variable MAINTENANCE to FALSE
  end
  [compiler end]
  Hide Dialog
end
[END REGION]
 
[END REGION]
 
[DEFINE REGION: Define Setup Globals]
Comment: Define Setup Components
Define Component: English
Define Component: Spanish
Define Component: French
Define Component: German
Define Component: Italian
 
Comment: Initialize Setup Globals
Get System Setting Windows NT Kernel (NT4, 2000, XP, 2003, Vista, 2008, 7, 2008 R2, 8, 2012) into ISNT
Get Folder Location System->Program Files Directory into PROGRAMFILES
Get Common Folder Location System->Program Files Directory into COMMONFILES
Get Common Folder Location Start Menu->Programs Group into SHORTCUTFILESALL
Get Folder Location Start Menu->Programs Group into SHORTCUTFILES
if Variable SHORTCUTFILESALL Equals 
  Set Variable SHORTCUTFILESALL to $SHORTCUTFILES$
end
Get Folder Location System->Desktop Directory into DESKTOPDIR
Get Folder Location System->Windows Directory into WINDIR
Get Folder Location System->System Directory into WINSYSDIR
Get Folder Location Taskbar->Quick Launch Directory into QUICKLAUNCHDIR
Get Folder Location WWW->WWWRoot into WWWROOTDIR
[END REGION]
 
[DEFINE REGION: Setup User Interview]
if Variable MAINTENANCE Equals TRUE
  GoTo Label: Maintenance
else
  [compiler if Variable BUILDMODE not Equals PATCH]
  Comment: First Time Install
  Set Variable STARTMENU to 
  [compiler end]
end
 
[compiler if Variable BUILDMODE not Equals PATCH]
label: ReadMe Information
Display Dialog: readme, wait for dialog to return (modal)
Set Variable alreadycdkey to 
Set Variable newcdkey to 
Set Variable skipcdkey to 
Set Variable ENGLISH to 
Set Variable SPANISH to 
Set Variable FRENCH to 
Set Variable GERMAN to 
Set Variable MODIFY to FALSE
Set Variable AOC_Tick to 
Set Variable REPAIR to FALSE
Set Variable ITALIAN to 
if Variable WIZARD Equals NEXT
  Write into Text File C:\2.dat from Value $words$ (at end of file)
else
  if Variable WIZARD Equals BACK
    GoTo Label: ReadMe Information
  else
    if Variable WIZARD Equals CANCEL
      GoTo Label: Main Install
    end
  end
end
label: User Registration
Comment: Display Dialog: registration, wait for dialog to return (modal)
if Variable WIZARD Equals BACK
  GoTo Label: ReadMe Information
else
  if Variable WIZARD Equals CANCEL
    GoTo Label: Main Install
  end
end
label: Setup Type
Display Dialog: setuptype, wait for dialog to return (modal)
if Variable WIZARD Equals NEXT
  if Variable ENGLISH not Equals TRUE
    if Variable SPANISH not Equals TRUE
      if Variable GERMAN not Equals TRUE
        if Variable ITALIAN not Equals TRUE
          if Variable FRENCH not Equals TRUE
            MessageBox: Language, Please Choose Language for your Empire Earth
            GoTo Label: Setup Type
          end
        end
      end
    end
  end
end
Comment: TO-DO: Customize your minimum setup here
if Variable ENGLISH Equals TRUE
  Select Component: English
  Deselect Component: German
  Deselect Component: French
  Deselect Component: Spanish
  Deselect Component: Italian
  Set Persistent Variable ENGLISH to TRUE
else
  if Variable FRENCH Equals TRUE
    Deselect Component: English
    Deselect Component: German
    Select Component: French
    Deselect Component: Spanish
    Deselect Component: Italian
    Set Persistent Variable FRENCH to TRUE
  else
    if Variable SPANISH Equals TRUE
      Deselect Component: English
      Deselect Component: German
      Deselect Component: French
      Select Component: Spanish
      Deselect Component: Italian
      Set Persistent Variable SPANISH to TRUE
    else
      if Variable GERMAN Equals TRUE
        Deselect Component: English
        Select Component: German
        Deselect Component: French
        Deselect Component: Spanish
        Deselect Component: Italian
        Set Persistent Variable GERMAN to TRUE
      else
        if Variable ITALIAN Equals TRUE
          Deselect Component: English
          Deselect Component: German
          Deselect Component: French
          Deselect Component: Spanish
          Select Component: Italian
          Set Persistent Variable ITALIAN to TRUE
        end
      end
    end
  end
end
if Variable WIZARD Equals CANCEL
  Terminate Installation
end
if Variable WIZARD Equals NEXT
  if Variable MODIFY Equals TRUE
    GoTo Label: Start Installation
  else
    GoTo Label: Destination Directory
  end
end
if Variable WIZARD Equals BACK
  if Variable MODIFY Equals TRUE
    GoTo Label: Maintenance
  else
    GoTo Label: ReadMe Information
  end
end
Comment: TO-DO: Customize your minimum setup here
label: Custom Setup
Comment: Display Dialog: componentstree (if variable PERSONALIZED is TRUE), wait for dialog to return (modal)
if Variable WIZARD Equals BACK
  GoTo Label: Setup Type
else
  if Variable WIZARD Equals CANCEL
    GoTo Label: Main Install
  end
end
label: Destination Directory
Display Dialog: destination, wait for dialog to return (modal)
if Variable WIZARD Equals BACK
  GoTo Label: Setup Type
else
  if Variable WIZARD Equals CANCEL
    Terminate Installation
  end
end
if Variable TARGETDIR Equals "Please Select Your Empire Earth Main Folder"
  MessageBox: Empire Earth Directory, Please Select Your Empire Earth Directory ... (Select Your Empire Earth Folder)
  GoTo Label: Destination Directory
else
  Does File Exist $TARGETDIR$\binkw32.dll (get result into variable SUCCESS1)
  if Variable SUCCESS1 not Equals TRUE
    MessageBox: Empire Earth Directory, Please Select Your Empire Earth Folder Correctly
    GoTo Label: Destination Directory
  else
    Does File Exist $TARGETDIR$\Data\data.ssa (get result into variable TargetExists1)
    if Variable TargetExists1 not Equals TRUE
      GoTo Label: Start Menu
    else
      if Variable AOC_Tick Equals TRUE
        Set Variable MYFOLDER to $TARGETDIRAOC$
        GoTo Label: Destination DirectoryAOC
      else
        GoTo Label: rf-Serial Dialog
      end
    end
  end
end
label: Destination DirectoryAOC
Display Dialog: registration, wait for dialog to return (modal)
if Variable WIZARD Equals NEXT
  Does File Exist $MYFOLDER$\EE-AOC.exe (get result into variable AOCTargetExistscheck)
  if Variable AOCTargetExistscheck Equals TRUE
    Set Variable TARGETDIRAOC to $MYFOLDER$
    GoTo Label: rf-Serial Dialog
  else
    MessageBox: Directory , Please Choose Art of Conquest Directory Correctly
    GoTo Label: Destination DirectoryAOC
  end
else
  if Variable WIZARD Equals BACK
    GoTo Label: Destination Directory
  else
    Terminate Installation
  end
end
label: rf-Serial Dialog
Display Dialog: welcome, wait for dialog to return (modal)
if Variable WIZARD Equals NEXT
  if Variable alreadycdkey Equals TRUE
    GoTo Label: rf-Username
  else
    if Variable skipcdkey Equals TRUE
      GoTo Label: Main Install
    else
      if Variable NEWCDKEY Equals TRUE
        GoTo Label: Main Install
      end
    end
  end
end
label: rf-Username
Display Dialog: licensecheck, wait for dialog to return (modal)
label: Start Menu
Display Dialog: startmenu, wait for dialog to return (modal)
if Variable WIZARD Equals BACK
  GoTo Label: Destination Directory
else
  if Variable WIZARD Equals CANCEL
    GoTo Label: Main Install
  end
end
[compiler end]
label: Start Installation
Comment: Display Dialog: startinstallation, wait for dialog to return (modal)
if Variable WIZARD Equals BACK
  [compiler if Variable BUILDMODE not Equals PATCH]
  GoTo Label: Start Menu
  [compiler else]
  GoTo Label: ReadMe Information
  [compiler end]
else
  GoTo Label: Main Install
end
 
label: Maintenance
Comment: Maintenance Install/Uninstall
wizard loop
Display Dialog: maintenance, wait for dialog to return (modal)
Display Dialog: setuptype (if variable MODIFY is TRUE), wait for dialog to return (modal)
end
[END REGION]
 
[DEFINE REGION: Process (Un)Installation]
label: Main Install
Comment: Exit Setup if Wizard Loop cancelled
if Variable WIZARD Equals CANCEL
  Terminate Installation
end
 
Comment: Prepare to install
Set Variable PROGRESSTEXT to Installing $TITLE$
Set Variable SUCCESS to 
Set Variable LASTERROR to 
if Variable ALLUSERS Equals TRUE
  Set Variable SHORTCUTFOLDER to $SHORTCUTFILESALL$\$STARTMENU$
else
  Set Variable SHORTCUTFOLDER to $SHORTCUTFILES$\$STARTMENU$
end
if Variable AOC_Exists Equals TRUE
  Create Shortcut $DESKTOPDIR$\The Art of Conquest to $TARGETDIRAOC$\EE-AOC.exe
end
Create Shortcut $DESKTOPDIR$\Empire Earth 2.0 to $TARGETDIR$\Empire Earth.exe
Display Dialog: progress, use as progress dialog (non-modal)
 
Comment: Modify Target System
[DEFINE REGION: Perform Uninstallation]
if Variable REMOVE Equals TRUE
  Comment: Uninstall product
  Comment: TO-DO: Insert any additional uninstall commands here
  Comment: <------------------------------------------------------------>
  Apply Uninstall (get result into variable SUCCESS)
  Set Variable PROGRESS to 100
else
  [END REGION]
  [DEFINE REGION: Perform First Time or Maintenance Installation]
  Comment: Install/Re-Install product
  if Variable patchphrase Equals "Omega"
    Delete Files $TARGETDIR$\Update Notes.txt (when installing)
  end
  if Variable patchphrase Equals "RC"
    Delete Files $TARGETDIR$\sxlrt234.dll (when installing)
  end
  if Variable patchphraseAOC Equals Patch : "Omega"
    Delete Files $TARGETDIRAOC$\Update Notes.txt (when installing)
  end
  if Variable TARGETDIRAOC not Equals 
    Does File Exist $TARGETDIRAOC$\EE-AOC.exe (get result into variable AOCexist_y)
    if Variable AOCexist_y Equals TRUE
      Delete Files $TARGETDIRAOC$\Data\db\*.* (when installing)
      Delete Files $TARGETDIRAOC$\Data\textures\*.* (when installing)
      Delete Files $TARGETDIRAOC$\Data\Models\*.* (when installing)
      Delete Files $TARGETDIRAOC$\Sierra Update\*.* (when installing)
      Delete Files $TARGETDIRAOC$\Sierra Update\SierraUpRes\*.* (when installing)
      Delete Files $TARGETDIRAOC$\EE-AOC.exe (when installing)
      Delete Registry KEY HKCU\Software\Mad Doc Software\EE-AOC\*.*
      Write Registry Key HKLM\SOFTWARE\Sierra On-Line\Empire Earth - The Art of Conquest\, 
      Write Registry Key HKLM\SOFTWARE\Sierra On-Line\Empire Earth - The Art of Conquest\1.0.0.0\,  (permanent)
      Write Registry Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\EE-AOC.exe\, $TARGETDIRAOC$\EE-AOC.exe
      Write Registry Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\EE-AOC.exe\Path, $TARGETDIRAOC$
      if Variable win8check Equals TRUE
        Write Registry Key HKCU\Software\Mad Doc Software\EE-AOC\Game Bit Depth, 32 (permanent)
      end
      if Variable SPANISH not Equals TRUE
        if Variable ITALIAN not Equals TRUE
          if Variable FRENCH not Equals TRUE
            if Variable GERMAN not Equals TRUE
              if Variable ENGLISH not Equals TRUE
                Set Variable ENGLISH to TRUE
              end
            end
          end
        end
      end
      if Variable ENGLISH Equals TRUE
        Delete Files $TARGETDIRAOC$\_wonkver.pub (when installing)
        Delete Files $TARGETDIRAOC$\Sierra Update\SierraUp.cfg (when installing)
        Delete Files $TARGETDIRAOC$\WONLobby.cfg (when installing)
        Delete Files $TARGETDIRAOC$\Sierra Update\zVersion.cfg (when installing)
        Delete Files $TARGETDIRAOC$\zzWONVersion.cfg (when installing)
        Write Registry Key HKLM\SOFTWARE\NeoEE Patch\Lang, ENGLISH (permanent)
      else
        if Variable SPANISH Equals TRUE
          Delete Files $TARGETDIRAOC$\_wonkver.pub (when installing)
          Delete Files $TARGETDIRAOC$\Sierra Update\SierraUp.cfg (when installing)
          Delete Files $TARGETDIRAOC$\WONLobby.cfg (when installing)
          Delete Files $TARGETDIRAOC$\Sierra Update\zVersion.cfg (when installing)
          Delete Files $TARGETDIRAOC$\zzWONVersion.cfg (when installing)
          Write Registry Key HKLM\SOFTWARE\NeoEE Patch\Lang, SPANISH (permanent)
        else
          if Variable FRENCH Equals TRUE
            Delete Files $TARGETDIRAOC$\_wonkver.pub (when installing)
            Delete Files $TARGETDIRAOC$\Sierra Update\SierraUp.cfg (when installing)
            Delete Files $TARGETDIRAOC$\WONLobby.cfg (when installing)
            Delete Files $TARGETDIRAOC$\Sierra Update\zVersion.cfg (when installing)
            Delete Files $TARGETDIRAOC$\zzWONVersion.cfg (when installing)
            Write Registry Key HKLM\SOFTWARE\NeoEE Patch\Lang, FRENCH (permanent)
          else
            if Variable ITALIAN Equals TRUE
              Delete Files $TARGETDIRAOC$\_wonkver.pub (when installing)
              Delete Files $TARGETDIRAOC$\Sierra Update\SierraUp.cfg (when installing)
              Delete Files $TARGETDIRAOC$\WONLobby.cfg (when installing)
              Delete Files $TARGETDIRAOC$\Sierra Update\zVersion.cfg (when installing)
              Delete Files $TARGETDIRAOC$\zzWONVersion.cfg (when installing)
              Write Registry Key HKLM\SOFTWARE\NeoEE Patch\Lang, ITALIAN (permanent)
            else
              if Variable GERMAN Equals TRUE
                Delete Files $TARGETDIRAOC$\_wonkver.pub (when installing)
                Delete Files $TARGETDIRAOC$\Sierra Update\SierraUp.cfg (when installing)
                Delete Files $TARGETDIRAOC$\WONLobby.cfg (when installing)
                Delete Files $TARGETDIRAOC$\Sierra Update\zVersion.cfg (when installing)
                Delete Files $TARGETDIRAOC$\zzWONVersion.cfg (when installing)
                Write Registry Key HKLM\SOFTWARE\NeoEE Patch\Lang, GERMAN (permanent)
              end
            end
          end
        end
      end
    end
  end
  Create Shortcut $SHORTCUTFOLDER$\Uninstall #TITLE# to $UNINSTALLLINK$
  [OFFLINE CONTENT]
  Delete Files $TARGETDIR$\Default.dll (when installing)
  Delete Files $TARGETDIR$\_wonkver.pub (when installing)
  Delete Files $TARGETDIR$\TCP Protocol.dll (when installing)
  Delete Files $TARGETDIR$\rmvparse.exe (when installing)
  Delete Files $TARGETDIR$\Miles Sound System Mixer.dll (when installing)
  Delete Files $TARGETDIR$\Low-Level Engine.dll (when installing)
  Delete Files $TARGETDIR$\Empire Earth.exe (when installing)
  Delete Files $TARGETDIR$\DX7HRTnLDisplay.dll (when installing)
  Delete Files $TARGETDIR$\DX7HRDisplay.dll (when installing)
  Comment: TO-DO: Insert any additional install commands here
  Parse String $TARGETDIR$ into Variables Drive and InstallDir (Split at first occurrence of pattern)
  Delete Registry KEY HKCU\Software\SSSI\Empire Earth\*.*
  Write Registry Key HKCU\Software\SSSI\Empire Earth\Installed From Volume, $Drive$ (permanent)
  Write Registry Key HKLM\SOFTWARE\Sierra OnLine\Setup\EEARTH\\Full Name, Empire Earth (permanent)
  Write Registry Key HKCU\Software\SSSI\Empire Earth\Installed From Directory, \$InstallDir$ (permanent)
  Write Registry Key HKLM\SOFTWARE\NeoEE Patch\,  (permanent)
  Write Registry Key HKLM\SOFTWARE\NeoEE Patch\EECDirectory, $TARGETDIR$ (permanent)
  Write Registry Key HKLM\SOFTWARE\NeoEE Patch\AOCDirectory, $TARGETDIRAOC$ (permanent)
  if Variable win8check Equals TRUE
    Write Registry Key HKCU\Software\SSSI\Empire Earth\Game Bit Depth, 32 (permanent)
  end
  [compiler if Variable BUILDMODE Equals PATCH]
  Apply Patch (get result into variable SUCCESS)
  [compiler else]
  if Variable ADVERTISE Equals TRUE
    Apply Advertised (get result into variable SUCCESS)
  else
    Write Registry Key HKLM\SOFTWARE\Sierra OnLine\Setup\EEARTH\Directory, $TARGETDIR$ (permanent)
    Write Registry Key HKLM\SOFTWARE\Sierra On-Line\, 
    Write Registry Key HKLM\SOFTWARE\Sierra On-Line\Empire Earth\,  (permanent)
    Write Registry Key HKLM\SOFTWARE\Sierra On-Line\Empire Earth\2.0.0.0\,  (permanent)
    Write Registry Key HKLM\SOFTWARE\Microsoft\, 
    Write Registry Key HKLM\SOFTWARE\Microsoft\Windows\, 
    Write Registry Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\, 
    Write Registry Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\, 
    Write Registry Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Empire Earth.exe\, $TARGETDIR$\Empire Earth.exe
    Write Registry Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Empire Earth.exe\Path, $TARGETDIR$
    if Variable SPANISH not Equals TRUE
      if Variable ITALIAN not Equals TRUE
        if Variable FRENCH not Equals TRUE
          if Variable GERMAN not Equals TRUE
            if Variable ENGLISH not Equals TRUE
              Set Variable ENGLISH to TRUE
            end
          end
        end
      end
    end
    if Variable ENGLISH Equals TRUE
      Delete Files $TARGETDIR$\Language.dll (when installing)
      Delete Files $TARGETDIR$\WONLobby.cfg (when installing)
      Delete Files $TARGETDIR$\zzWONVersion.cfg (when installing)
    end
    if Variable SPANISH Equals TRUE
      Delete Files $TARGETDIR$\Language.dll (when installing)
      Delete Files $TARGETDIR$\WONLobby.cfg (when installing)
      Delete Files $TARGETDIR$\zzWONVersion.cfg (when installing)
    end
    if Variable FRENCH Equals TRUE
      Delete Files $TARGETDIR$\Language.dll (when installing)
      Delete Files $TARGETDIR$\zzWONVersion.cfg (when installing)
      Delete Files $TARGETDIR$\WONLobby.cfg (when installing)
    end
    if Variable GERMAN Equals TRUE
      Delete Files $TARGETDIR$\Language.dll (when installing)
      Delete Files $TARGETDIR$\zzWONVersion.cfg (when installing)
      Delete Files $TARGETDIR$\WONLobby.cfg (when installing)
    end
    if Variable ITALIAN Equals TRUE
      Delete Files $TARGETDIR$\Language.dll (when installing)
      Delete Files $TARGETDIR$\zzWONVersion.cfg (when installing)
      Delete Files $TARGETDIR$\WONLobby.cfg (when installing)
    end
    Delete Files $TARGETDIR$\Data\db\*.* (when installing)
    Delete Files $TARGETDIR$\Data\textures\*.* (when installing)
    Delete Files $TARGETDIR$\Data\Models\*.* (when installing)
    Delete Files $TARGETDIR$\Data\WONLobby Resources\*.* (when installing)
    Delete Files $TARGETDIR$\Sierra Update\SierraUpRes\*.* (when installing)
    Delete Files $TARGETDIR$\sxlrt234.dll (when installing)
    Delete Files $TARGETDIR$\Data\WONLobby Resources\Help\*.* (when installing)
    Delete Files $TARGETDIR$\Data\WONLobby Resources\Images\*.* (when installing)
    Delete Files $TARGETDIR$\Data\WONLobby Resources\Icons\*.* (when installing)
    Delete Files $TARGETDIR$\Data\WONLobby Resources\Sounds\*.* (when installing)
    Delete Files $TARGETDIR$\Data\WONLobby Resources\Skin\*.* (when installing)
    Delete Files $TARGETDIR$\Sierra Update\*.* (when installing)
    Apply Install (get result into variable SUCCESS)
  end
  [compiler end]
  Set Variable PROGRESS to 100
end
[END REGION]
[END REGION]
 
[DEFINE REGION: Finish Setup]
Comment: End of Installation
Hide Dialog
Display Dialog: finish, wait for dialog to return (modal)
if Variable SILENT Equals FALSE
  if Variable REBOOTCOMPUTER Equals TRUE
    if Variable SUCCESS Equals REBOOT
      Reboot Computer
    end
  end
  if Variable RUNAPP Equals TRUE
    if Variable REMOVE Equals FALSE
      if Variable SUCCESS Equals COMPLETE
        Comment: TO-DO: Insert command that starts your application here
      end
    end
  end
end
[END REGION]
 
